-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(scripting/lua): correct LuaNativeContext constructor #2286
Conversation
bdd8733
to
d68c321
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution, only a small style concern. If you're able could you also check if it has other uninitialized fields?
LUA_INLINE LuaNativeContext(void*, int numArguments) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of renaming a fine parameter name, you can initialize them like this (preferred in C++):
LUA_INLINE LuaNativeContext(void*, int numArguments)
: numArguments(numArguments)
, numResults(0)
{
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That struct inherits fxNativeContext.
The amount of bloat/cruft in this area is quite high.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of renaming a fine parameter name, you can initialize them like this (preferred in C++):
LUA_INLINE LuaNativeContext(void*, int numArguments) : numArguments(numArguments) , numResults(0) { }
I originally did this, however it required me to redefine those fields again in the struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️I see... just do this->numArguments = numArguments
for now then, we'll get to it later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
d68c321
to
33173c1
Compare
33173c1
to
3f9b239
Compare
Fixes #2183 and the forums post referenced (SetPlayerRoutingBucket, SetEntityRoutingBucket natives)
Repro